#ifndef ABSTRACTTABLE_H
#define ABSTRACTTABLE_H

#include <string>

using namespace std;

// forward declarations.
class SchemaComponentFormula;
class ColumnList;

/*
    Class: SchemaComponent.
    Abstract class to extend by Table and View classes.
*/
class SchemaComponent
{
    /* Section: public */
    public:
        /*
            Destructor: Default destructor.
            Destroy the object.
        */
        virtual ~SchemaComponent();

        /*
            Method: setName
            Sets the name of the SchemaComponent

            Parameters:
                name - Name to set.
        */
        virtual void setName(const string & name);

        /*
            Method: getName
            Returns:
                The name of the SchemaComponent
        */
        virtual string getName() const;

        /*
            Method: toString
            Returns:
                String representation of the SQL table o SQL view.
        */
        virtual string toString() = 0;

	/*
	 * Method getColumns
	 * Returns:
	 * 	The list of column names of the View/Table
	 */
	virtual ColumnList * getColumns() = 0;

	/*
            Method: clone
            Returns:
                A pointer to a SchemaComponent clone.
        */
        virtual SchemaComponent * clone() = 0;

    /* Section: protected */
    protected:
        /*
            Constructor: Default constructor.
            Initializes the object.

            Parameters:
                name - Name of the SchemaComponent ("" by default).
        */
        SchemaComponent(const string & name = "");

        /*
            Variable: name
            Type: string
            Name of the table.
        */
        string name;
};

#endif // ABSTRACTTABLE_H
